<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>

<body>

{[foreach name=outer key=key item=item from=$result]}
{[if $smarty.foreach.outer.first]}
<h3 align="center">{[if $item.purchase_x.customer_x->fullname neq '']}
广东景荣产品有限公司
{[else]}
景荣精密产品（深圳）有限公司
{[/if]}<br/>
对帐单</h3>

供应商：{[$item.supplier_x->fullname]} 结式方式：{[$item.purchase_x.type]} <br/>
联系人：{[$item.supplier_x->contact]} 电话：{[$item.supplier_x->tel]} 传真：{[$item.supplier_x->fax]} {[if $item.purchase_x.tax ne 0]}税率：{[$item.purchase_x.tax|string_float]}%{[else]}不含税{[/if]}
<table border="1" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
	<tr align="center">
		<th>序号</th>
		<th>入库日期</th>
		<th>入库员</th>
		<th>送货单</th>
		<th>进货单</th>
		<th>订购单</th>
		
		<th>品名</th>
		<th>规格</th>
		
		<th>单位</th>
		<th>数量</th>
		<th>单价</th>
		
		<th>单价</th>
		<th>单位</th>
		<th>重量</th>
		<th>实际</th>
		
		<th>金额</th>
		<th>备注</th>
		<th>退货情况</th>
	</tr>
{[/if]}
	
	{[foreach name=outer2 key=key2 item=item2 from=$item.in_list]} 
	{[assign var="no" value="`$no+1`"]}
	{[assign var="pp" value="`$item.purchase_x.tax/100`"]}
	
	<tr align="center">
		<td>{[$no]}</td>
		<td>{[$item.date]}</td>
		<td>{[$item.emp_t]}</td>
		
		<td>{[$item.number]}</td>
		<td>{[$item.id]}</td>
		<td>{[$item.purchase]}</td>
		
		<td>{[$item2.name]}</td>
		<td>{[$item2.standard]}</td>
		
		<td>{[$item2.unit]}</td>
		<td>{[$item2.amount]}</td>
		<td>{[$item2.price+$item2.price*$pp|money]}</td>
		
		{[if $item2.unit neq $item2.unit2]}
		{[assign var="t1" value="`$item2.amount3*$item2.price2`"]}
		{[assign var="t2" value="`$t1`"]}
		{[assign var="totals" value="`$totals+$t1`"]}
		<td>{[$item2.price2]}</td>
		<td>{[$item2.unit2]}</td>
		
		<td>{[$item2.amount2|money]}</td>
		<td>{[$item2.amount3|money]}</td>
		{[else]}
		{[assign var="t1" value="`$item2.amount*$item2.price`"]}
		{[assign var="t2" value="`$t1+$t1*$pp`"]}
		{[assign var="totals" value="`$totals+$t2`"]}
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		{[/if]}
		
		<td>{[$t2|money]}</td>
		
		<td>{[$item2.content|truncate:21:"...":true]}</td>
		<td>{[if $item.returned]}有{[/if]}</td>
	</tr>
	{[/foreach]}
	{[/foreach]}
	<tr align="center">
		<td colspan="15">总计（大写）{[$item.purchase_x.currency_t]} {[$totals|rmb]}</td>
		<td>{[$totals|money]}</td>
		<td colspan="2"></td>
	</tr>
	<tr>
		<td colspan="18" valign="top" style="font-size:12px;">备注：<br/>
		<br/></td>	
	</tr>
</table>

<br/>
<p>总经理：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;财务经理：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;会计：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
采购经理：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;采购员：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;供应商：</p>

</body>
</html>
